﻿<phone:PhoneApplicationPage 
    x:Class="CalciumTemplateApp.Views.Examples.ValidationPivotView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c="clr-namespace:DanielVaughan.Windows.Controls;assembly=Calcium.Phone"
    xmlns:c2="clr-namespace:DanielVaughan.Windows;assembly=Calcium.Phone"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="{Binding AppSettings.SystemTrayVisible, FallbackValue=true}"
    c2:VisualStateUtility.VisualState="{Binding VisualState}"
    Style="{StaticResource PageStyle}">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <TextBlock TextWrapping="Wrap">
                The following controls are bound to viewmodel properties 
                that are validated. If you hit the back button, 
                and the form is invalid or incomplete, 
                then a warning is displayed; hit cancel and you are taken 
                back to this pivot item.</TextBlock>
            <TextBlock Text="validated string 1" 
                       Style="{StaticResource LabelTextStyle}" />
            <TextBox Text="{Binding ValidatedString1, Mode=TwoWay, 
                                        NotifyOnValidationError=True}"
                     Style="{StaticResource ValidatingTextBoxStyle}" />
            <TextBlock Text="validated string 2" 
                       Style="{StaticResource LabelTextStyle}" />
            <TextBox Text="{Binding ValidatedString2, Mode=TwoWay, 
                                        NotifyOnValidationError=True}"                     
                     Style="{StaticResource ValidatingTextBoxStyle}" />
            <c:ValidationSummary Height="200" />
        </StackPanel>

        <c:AppBar>
            <c:AppBarIconButton 
                    Command="{Binding SubmitCommand}"
                    Text="Submit"
                    IconUri="/Views/Images/AppBar/appbar.check.rest.png" />
            <c:AppBar.MenuItems>
                <c:AppBarMenuItem Text="hi" />
            </c:AppBar.MenuItems>
        </c:AppBar>
    </Grid>
 
</phone:PhoneApplicationPage>
